package main

import (
	"fmt"
	"net/http"
	"time"

	"github.com/gin-gonic/gin"
)

func sayhello(c *gin.Context) {
	start := time.Now()
	c.Next()
	cost := time.Since(start)
	fmt.Println("花费了：", cost.Seconds(), "秒")
	c.JSON(http.StatusOK, gin.H{
		"message": "hello world",
	})
}
func m1(c *gin.Context) {
	fmt.Println("qwwe")
}
func main() {
	r := gin.Default()
	r.GET("/", m1, sayhello)
	r.Run(":6861")
}
